package com.Example;

import com.utils.CertUtil;
import com.utils.KeyUtil;

import java.util.List;

/**
 * @author zyf
 */
public class ReadPemTest {
    public static void main(String[] args) {
        try {
//        int priStart = pemStr.indexOf("-----BEGIN ENCRYPTED PRIVATE KEY-----");
//        int priEnd = pemStr.lastIndexOf("-----END ENCRYPTED PRIVATE KEY-----");
//        String priPem = pemStr.substring(priStart,priEnd).concat("-----END ENCRYPTED PRIVATE KEY-----");
//        int cerStart = pemStr.indexOf("-----BEGIN CERTIFICATE-----");
//        int cerEnd = pemStr.lastIndexOf("-----END CERTIFICATE-----");
//        String cerPem = pemStr.substring(cerStart,cerEnd).concat("-----END CERTIFICATE-----");
            System.out.println(KeyUtil.readPemPrivateKey("Json/pri.pem", ""));
            System.out.println(KeyUtil.generatePrikeyWithPem("Json/pri.pem", ""));
            List keyList = CertUtil.generatePrikeyCertWithPem("Json/1.pem","");
            System.out.println(keyList);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
